<?php

/**
 * Concept form.
 *
 * @package    ideas
 * @subpackage form
 * @author     AlvaroLara
 */
class ConceptForm extends BaseConceptForm
{
  public function configure()
  {
    unset($this['idea_concept_list']);
    $this->setWidget('concept_status_id', new sfWidgetFormInputHidden());
    $this->setDefault('concept_status_id', ConceptStatusPeer::pendingStatusId());
    
    $wikipedia_link_widget = $this->getWidget('wikipedia_link');

    $this->setWidget('wikipedia_link', new dcWidgetFormAjaxDependence(array(
              'dependant_widget' => $wikipedia_link_widget,
              'observe_widget_id' => 'concept_is_wikipedia',
              'observe_widget_is_boolean' => false,
              'message_with_no_value' => 'Will be enabled when choosing is wikipedia.',
              'get_observed_value_callback' => array(get_class($this),'isWikipediaChanged'),
    )));

    $this->setValidator('wikipedia_link', new sfValidatorUrl(array('required' => false)));
  }

  public static function isWikipediaChanged($widget , $value)
  {
    
  }
}
